package com.lktx.bbfactory.common.gantt;

import com.lktx.bbfactory.entiy.DTO.GanttConfigDto;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;


@Getter
@AllArgsConstructor
public enum GanttStatusGgy {
    PROJECT_INITIATION(1, "立项"),
    MATERIAL_PREPARATION(2, "材料准备"),
    MATERIAL_PRODUCTION(3, "材料生产"),
    PROCESSING(4, "加工"),
    INSPECTION(5, "检验"),
    SHIPPING(6, "发货");
    private final Integer id;
    private final String name;


    public static List<GanttConfigDto> getGanttTemplate() {
        return Arrays.stream(GanttStatusGgy.values()).sorted(Comparator.comparingInt(GanttStatusGgy::getId)).map(k-> new GanttConfigDto(k.id, k.getName(), new ArrayList<>())).toList();
    }

}
